<template>
  <div class="integral">
    <el-table :data="tableData" border style="width: 100%">
      <el-table-column prop="user" align="center" label="用户" />
      <el-table-column prop="phone" align="center" label="联系方式" />
      <el-table-column prop="area" align="center" width="250" label="住址" />
      <el-table-column prop="time" align="center" label="统计时间" />
      <el-table-column prop="num" align="center" label="累计积分" />
    </el-table>
    <!-- 分页 -->
    <el-col :span="24" class="toolbar" style="text-align: center;">
      <el-pagination
        background
        :current-page="currentPage"
        :page-count="pageNum"
        :page-size="pagesize"
        style="margin-top:30px;margin-bottom:30px"
        layout="total, prev, pager, next, jumper"
        :total="total"
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
      />
    </el-col>
  </div>
</template>
<script>
export default {
  data() {
    return {
      currentPage: 1, // 初始页
      pagesize: 10, // 当前页面内的列表行数
      pageCount: 1,
      pageNum: 1, // 页数
      total: 8,
      tableData: [
        {
          user: '张元',
          phone: '13455555555',
          area: '浙江省杭州市下城区下沙大都会风情苑9幢4单502元室',
          time: '2019-12-01 10:00',
          num: '200分'
        },
        {
          user: '张元',
          phone: '13455555555',
          area: '浙江省杭州市下城区下沙大都会风情苑11幢1单元101室',
          time: '2019-12-01 10:00',
          num: '200分'
        },
        {
          user: '张元',
          phone: '13455555555',
          area: '浙江省杭州市下城区下沙大都会风情苑11幢1单元101室',
          time: '2019-12-01 10:00',
          num: '200分'
        },
        {
          user: '张三',
          phone: '13455555555',
          area: '浙江省杭州市下城区下沙大都会风情苑11幢1单元101室',
          time: '2019-12-01 10:00',
          num: '200分'
        },
        {
          user: '李斯',
          phone: '13455555555',
          area: '浙江省杭州市下城区下沙大都会风情苑5幢4单元402室',
          time: '2019-12-01 10:00',
          num: '200分'
        },
        {
          user: '张元',
          phone: '13455555555',
          area: '浙江省杭州市下城区下沙大都会风情苑9幢1单元202室',
          time: '2019-12-01 10:00',
          num: '200分'
        },
        {
          user: '王二',
          phone: '13455555555',
          area: '浙江省杭州市下城区下沙大都会风情苑11幢1单元303室',
          time: '2019-12-01 10:00',
          num: '200分'
        },
        {
          user: '张元',
          phone: '13455555555',
          area: '浙江省杭州市下城区下沙大都会风情苑11幢1单元101室',
          time: '2019-12-01 10:00',
          num: '200分'
        }

      ]
    }
  },
  mounted() {},
  methods: {
    // 当前页
    handleSizeChange: function(pagesize) {
      this.pagesize = pagesize
    },
    // 换页：更新列表数据
    handleCurrentChange: function(currentPage) {
      this.currentPage = currentPage
    }
  }
}
</script>
<style lang="scss" scoped>
.integral {
  margin-top: 55px;
}
</style>
